home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.awt;
-
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Rectangle;
-
- public class CellHints {
- Rectangle bounds = new Rectangle();
- int align;
- int valign;
- boolean editable = true;
- boolean visible = true;
- Font font;
- // $FF: renamed from: fg java.awt.Color
- Color field_0;
- // $FF: renamed from: bg java.awt.Color
- Color field_1;
- Color hfg;
- Color hbg;
- boolean highlighted;
- boolean lineTop;
- boolean lineBottom;
- boolean lineLeft;
- boolean lineRight;
- int lineTopStyle;
- int lineBottomStyle;
- int lineLeftStyle;
- int lineRightStyle;
- Color lineTopColor;
- Color lineBottomColor;
- Color lineLeftColor;
- Color lineRightColor;
- int bits;
- public static final int ALIGN_BIT = 0;
- public static final int VALIGN_BIT = 1;
- public static final int EDITABLE_BIT = 2;
- public static final int VISIBLE_BIT = 3;
- public static final int FONT_BIT = 4;
- public static final int FG_BIT = 5;
- public static final int BG_BIT = 6;
- public static final int HFG_BIT = 7;
- public static final int HBG_BIT = 8;
- public static Font stdFont = new Font("Dialog", 0, 12);
- Grid view;
- TableCell cell;
-
- public CellHints(Grid var1) {
- this.font = stdFont;
- this.field_0 = Color.black;
- this.field_1 = Color.white;
- this.hfg = Color.white;
- this.hbg = Color.blue;
- this.highlighted = false;
- this.lineTop = true;
- this.lineBottom = true;
- this.lineLeft = true;
- this.lineRight = true;
- this.lineTopStyle = 1;
- this.lineBottomStyle = 1;
- this.lineLeftStyle = 1;
- this.lineRightStyle = 1;
- this.lineTopColor = Color.gray;
- this.lineBottomColor = Color.gray;
- this.lineLeftColor = Color.gray;
- this.lineRightColor = Color.gray;
- this.view = var1;
- }
-
- public void set(int var1) {
- this.bits |= 1 << var1;
- }
-
- public void clear(int var1) {
- this.bits = (int)((long)this.bits & ~(1L << var1));
- }
-
- public boolean get(int var1) {
- return (this.bits >> var1 & 1) != 0;
- }
-
- public void setForeground(Graphics var1) {
- if (this.highlighted) {
- var1.setColor(this.hfg);
- } else {
- var1.setColor(this.field_0);
- }
- }
-
- public void setBackground(Graphics var1) {
- if (this.highlighted) {
- var1.setColor(this.hbg);
- } else {
- var1.setColor(this.field_1);
- }
- }
-
- public void setHints(TableCell var1) {
- this.cell = var1;
- if (this.cell.type() == 3) {
- this.setCornerCellHints(var1);
- } else {
- if (this.cell.type() != 2) {
- this.cell.type();
- }
-
- this.bounds = this.view.getCellBounds(var1, this.bounds);
- this.align = this.view.getCellAlignment(var1);
- this.field_0 = this.view.getCellFG(var1);
- this.field_1 = this.view.getCellBG(var1);
- this.editable = this.view.getCellEditable(var1);
- this.highlighted = this.view.getCellHighlighted(var1);
- this.font = this.view.getCellFont(var1);
- }
- }
-
- void setCornerCellHints(TableCell var1) {
- CellHints var2 = this.view.rowHeadingHints;
- this.bounds = this.view.getCellBounds(var1, this.bounds);
- this.align = var2.align;
- this.field_0 = var2.field_0;
- this.field_1 = var2.field_1;
- this.editable = var2.editable;
- this.highlighted = this.view.isViewSelected();
- this.font = var2.font;
- }
-
- public void drawBoundary(Graphics var1) {
- Rectangle var2 = this.bounds;
- if (this.lineTop) {
- var1.setColor(this.lineTopColor);
- var1.drawLine(var2.x, var2.y, var2.x + var2.width - 1, var2.y);
- }
-
- if (this.lineBottom) {
- var1.setColor(this.lineBottomColor);
- var1.drawLine(var2.x, var2.y + var2.height - 1, var2.x + var2.width - 1, var2.y + var2.height - 1);
- }
-
- if (this.lineLeft) {
- var1.setColor(this.lineLeftColor);
- var1.drawLine(var2.x, var2.y, var2.x, var2.y + var2.height - 1);
- }
-
- if (this.lineRight) {
- var1.setColor(this.lineRightColor);
- var1.drawLine(var2.x + var2.width - 1, var2.y, var2.x + var2.width - 1, var2.y + var2.height - 1);
- }
-
- }
-
- public boolean isVisible() {
- return this.visible;
- }
-
- public boolean cascadeIsVisible(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(3)) {
- return var2.visible;
- } else {
- return var1 != null && var1.get(3) ? var1.visible : this.visible;
- }
- }
-
- public Rectangle bounds() {
- return this.bounds;
- }
-
- public int alignment() {
- return this.align;
- }
-
- public int cascadeAlignment(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(0)) {
- return var2.align;
- } else {
- return var1 != null && var1.get(0) ? var1.align : this.align;
- }
- }
-
- public boolean editable() {
- return this.editable;
- }
-
- public boolean cascadeEditable(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(2)) {
- return var2.editable;
- } else {
- return var1 != null && var1.get(2) ? var1.editable : this.editable;
- }
- }
-
- public int vAlignment() {
- return this.valign;
- }
-
- public int cascadeVAlignment(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(1)) {
- return var2.valign;
- } else {
- return var1 != null && var1.get(1) ? var1.valign : this.valign;
- }
- }
-
- public Font font() {
- return this.font;
- }
-
- public Font cascadeFont(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(4)) {
- return var2.font;
- } else {
- return var1 != null && var1.get(4) ? var1.font : this.font;
- }
- }
-
- public Color foreground() {
- return this.field_0;
- }
-
- public Color cascadeForeground(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(5)) {
- return var2.field_0;
- } else {
- return var1 != null && var1.get(5) ? var1.field_0 : this.field_0;
- }
- }
-
- public Color background() {
- return this.field_1;
- }
-
- public Color cascadeBackground(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(6)) {
- return var2.field_1;
- } else {
- return var1 != null && var1.get(6) ? var1.field_1 : this.field_1;
- }
- }
-
- public boolean highlighted() {
- return this.highlighted;
- }
-
- public Color hlForeground() {
- return this.hfg;
- }
-
- public Color cascadeHlForeground(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(7)) {
- return var2.hfg;
- } else {
- return var1 != null && var1.get(7) ? var1.hfg : this.hfg;
- }
- }
-
- public Color hlBackground() {
- return this.hbg;
- }
-
- public Color cascadeHlBackground(CellHints var1, CellHints var2) {
- if (var2 != null && var2.get(8)) {
- return var2.hbg;
- } else {
- return var1 != null && var1.get(8) ? var1.hbg : this.hbg;
- }
- }
-
- public boolean lineTop() {
- return this.lineTop;
- }
-
- public boolean lineBottom() {
- return this.lineBottom;
- }
-
- public boolean lineLeft() {
- return this.lineLeft;
- }
-
- public boolean lineRight() {
- return this.lineRight;
- }
-
- public Color lineTopColor() {
- return this.lineTopColor;
- }
-
- public Color lineBottomColor() {
- return this.lineBottomColor;
- }
-
- public Color lineLeftColor() {
- return this.lineLeftColor;
- }
-
- public Color lineRightColor() {
- return this.lineRightColor;
- }
-
- public int lineTopStyle() {
- return this.lineTopStyle;
- }
-
- public int lineBottomStyle() {
- return this.lineBottomStyle;
- }
-
- public int lineLeftStyle() {
- return this.lineLeftStyle;
- }
-
- public int lineRightStyle() {
- return this.lineRightStyle;
- }
- }
-